import { INestApplication, Injectable } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';

@Injectable()
export class PrismaService extends PrismaClient{
   
    //确保在关闭过程中与当前从服务器接收响应的客户端进行正常通信。轻松体验可靠且无忧的服务器关闭1。
    async enableShutdownHooks(app: INestApplication) {
        this.$on('beforeExit' as never, async () => {
          await app.close();
        });

   }
    

}
